package com.ywjg.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ywjg.model.AppGood;
import com.ywjg.model.GoodToOrder;
import com.ywjg.model.NewsMessage;

public class BigNoNameBean<T>{
	
	public  Map<String, Object> getMap(List<AppGood> list,int count,T t){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("@type", "table");
		map.put("userdata", new SmallNoNameBean().getUserDataBean(list,count));
		List<GoodToSBSBGood> sbsbGoods = new ArrayList<GoodToSBSBGood>();
		for(AppGood y:list ) {
			GoodToSBSBGood appUserToSb = TTT.appUserToSb(y);
			sbsbGoods.add(appUserToSb);
		}
		map.put("rows", sbsbGoods);
		return map;
	}
	
	
	
	public  Map<String, Object> getOrderMap(List<GoodToOrder> list,int count){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("@type", "table");
		map.put("userdata", new SmallNoNameBean().getUserDataBean(count));
		List<OrderTOSBOrder> rrr = new ArrayList<OrderTOSBOrder>();
		for(GoodToOrder y:list ) {
			 OrderTOSBOrder orderToSbSBOrder = TTT.orderToSbSBOrder(y);
			rrr.add(orderToSbSBOrder);
		}
		map.put("rows", rrr);
		return map;
	}
	
	
	public  Map<String, Object> getNewsMap(List<NewsMessage> list,int count){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("@type", "table");
		map.put("userdata", new SmallNoNameBean().getUserNewsBean(count));
		List<SBNews> rrr = new ArrayList<SBNews>();
		for(NewsMessage y:list ) {
			  SBNews newsToSBNews = TTT.NewsToSBNews(y);
			rrr.add(newsToSBNews);
		}
		map.put("rows", rrr);
		return map;
	}
	
	
	
	
	
	
	
	
	

}
